home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 0022-3.564 / dmg-3417 / gfa_prog.s / gfa_peak.lst next >
File List  |  1989-04-05  |  3KB  |  67 lines

  1. ON ERROR GOSUB einde
  2. ON BREAK GOSUB einde
  3. INLINE music%,22000
  4. '                                     ! inline is for reserving some space to
  5. '                                     ! put the music in.
  6. DIM reg%(16),ba$(16)                  ! dimension some space
  7. level_bars                            ! make level bars
  8. '
  9. DO                                    ! oke lets start...
  10.   FILESELECT "a:\music\*.thk","",fnam$! fileselector to choose music.
  11.   IF fnam$<>""                        ! if name isn't nothing then
  12.     BLOAD fnam$,music%                ! load music into reserved space
  13.     musix_on                          ! gosub routine to start music
  14.     bars                              ! goto level bars show...
  15.     ~INP(2)                           ! wait for key press
  16.     musix_off                         ! stop music
  17.   ELSE                                ! if name is nothing then
  18.     musix_off                         ! stop music
  19.     END                               ! back to basic or if compiled desktop
  20.   ENDIF                               ! end
  21. LOOP                                  ! goto start again to do it all over again
  22. PROCEDURE musix_on
  23.   do%=GEMDOS(&H20,L:0)                ! supervisor mode
  24.   reg%(0)=1                           ! choose music
  25.   RCALL music%,reg%()                 ! music call
  26.   SLPOKE &H4D2,music%+8               ! begin address music diskmagazine 2
  27.   ' SLPOKE &H4D2,music%+4             ! begin address music diskmagazine 1
  28.   ~GEMDOS(&H20,L:do%)                 ! user mode
  29. RETURN
  30. '
  31. PROCEDURE musix_off
  32.   do%=GEMDOS(&H20,L:0)                ! supervisor mode
  33.   SLPOKE &H4D2,0                      ! stop music
  34.   WAVE 0,0,0,0                        ! all sound off
  35.   ~GEMDOS(&H20,L:do%)                 ! user mode kiezen
  36. RETURN
  37. '
  38. PROCEDURE einde
  39.   musix_off
  40.   END
  41. RETURN
  42. '
  43. PROCEDURE level_bars
  44.   CLS                                   ! clear the screen
  45.   FOR t=0 TO 15                         ! for_next loop
  46.     BOX 0,16,8,15-t                     ! draw a box in 16 different hights
  47.     GET 0,0,8,16,ba$(t)                 ! get the different hights
  48.   NEXT t                                ! draw next box
  49.   CLS                                   ! clear screen again
  50. RETURN
  51. '
  52. PROCEDURE bars
  53.   WHILE NOT INP?(2)                      ! if no key press then.. <---
  54.     PUT 0,30,ba$(XBIOS(28,0,8))          ! put volume bar channel 1   |
  55.     PUT 10,30,ba$(XBIOS(28,0,9))         ! put volume bar channel 2   |
  56.     PUT 20,30,ba$(XBIOS(28,0,10))        ! put volume bar channel 3   |
  57.     PUT 30,30,ba$((XBIOS(28,0,0) DIV 16))! put tone bar channel 1     |
  58.     PUT 40,30,ba$((XBIOS(28,0,2) DIV 16))! put tone bar channel 2     |
  59.     PUT 50,30,ba$((XBIOS(28,0,4) DIV 16))! put tone bar channel 3     |
  60.     '                                                                 |
  61.     ' The first 3 are volume bars, always from 0 to 15.               |
  62.     ' The last 3 are tone hights, from 0 to 255. We only got 16 level |
  63.     ' bars so we DIV it by 16 and then it works with 16 level bars.   |
  64.     '                                                                 |
  65.   WEND                                   ! and back to above      -----
  66. RETURN                                   ! back to main loop...
  67.